package org.pay.union.core;

import org.pay.union.enums.DebitCredit;
import org.pay.union.enums.TradeTypeEnum;
import org.pay.union.enums.debitcredit.AliPayCreditEnum;
import org.pay.union.enums.debitcredit.UnionPayCreditEnum;
import org.pay.union.enums.debitcredit.WeChatDebitCreditEnum;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;

/**
 * @author Administrator
 */
public abstract class PlatForm {
    /**
     * 网关地址
     */
    public static final String QRA_GETEWAY = "https://qra.95516.com/pay/gateway" ;
    public static final String UP_GETEWAY = "https://up.95516.com/payapi/gateway" ;
    /**
     * 默认商品名称
     */
    public static final String DEFAULT_BODY = "技术服务费" ;

    public static final Map<TradeTypeEnum, Function<String, DebitCredit>> DEBIT_CREDIT_CENTER = new ConcurrentHashMap<>(6);

    static {
        DEBIT_CREDIT_CENTER.put(TradeTypeEnum.alipay, AliPayCreditEnum::valueOf);
        DEBIT_CREDIT_CENTER.put(TradeTypeEnum.weixin, WeChatDebitCreditEnum::valueOf);
        DEBIT_CREDIT_CENTER.put(TradeTypeEnum.unionpay, UnionPayCreditEnum::codeOf);
    }
}
